/<template>
  <el-dialog
    title="批量关注加群"
    :visible.sync="show"
    width="500px"
    :before-close="beforeclose"
  >
    <el-form
      :model="form"
      label-position="left"
    >
      <el-form-item label="关注加群">
        <el-switch
          v-model="dy_flow_switch"
          active-value="1"
          inactive-value="2"
        >
        </el-switch>
      </el-form-item>
    </el-form>
    <div
      slot="footer"
      class="dialog-footer"
    >
      <el-button @click="beforeclose">取 消</el-button>
      <el-button
        type="primary"
        @click="ok"
      >确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { batchchannelbatchFlowSwitch } from '@/api/channel'
export default {
  props: {
    channelId: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      show: true,
      dy_flow_switch: 2,
      form: {}
    }
  },
  mounted() {},
  methods: {
    beforeclose() {
      console.log('12456789')
      this.$emit('close')
    },
    async ok() {
      const res = await batchchannelbatchFlowSwitch({
        channel_id: this.channelId,
        dy_flow_switch: this.dy_flow_switch
      })
      if (res.status_code === 1) {
        this.$message.success(res.msg)
        this.$emit('ok')
      }
    }
  }
}
</script>
<style lang="scss" scoped>
::v-deep .el-dialog__footer {
  padding: 0;
}
</style>